<template>
  <div>
    <div class="login-Account-Css">
      <div class="login-Router-Link-Css">
        <div class="login-Router-Link-Left-Css">
          <router-link class="router-link" to="/accountLogin"
            >用户登录</router-link
          >
        </div>
        <div class="login-Router-Link-Right-Css">
          <router-link class="router-link" to="/accountRegister"
            >用户注册</router-link
          >
        </div>
      </div>
      <div>
        <img
          alt="切换登录注册页面"
          src="../../assets/切换.png"
          style="background-color: aqua; cursor: pointer; border-radius: 10px"
          @click="jumpOtherPage"
        />
      </div>
      <div class="login-Router-View-Css"><router-view></router-view></div>
    </div>
    <vue-particles
      color="#fff"
      :particleOpacity="0.7"
      :particlesNumber="60"
      shapeType="circle"
      :particleSize="4"
      linesColor="#fff"
      :linesWidth="1"
      :lineLinked="true"
      :lineOpacity="0.4"
      :linesDistance="150"
      :moveSpeed="2"
      :hoverEffect="true"
      hoverMode="grab"
      :clickEffect="true"
      clickMode="push"
      class="login-BGCanvas-Css"
    >
    </vue-particles>
  </div>
</template>

<script>
export default {
  name: "login",
  data: function () {
    return {};
  },
  components: {},
  props: {},
  methods: {
    jumpOtherPage() {
      var path = this.$route.path;
      if (path === "/accountLogin") {
        this.$router.push({ path: "/accountRegister" });
      } else {
        this.$router.push({ path: "/accountLogin" });
      }
    },
  },
  setup() {
    //console.log("生命周期开始！");
  },
  mounted() {
    this.$router.push({ path: "/accountLogin" });
  },
  watch: {},
};
</script>

<style scoped>
.login-Account-Css {
  color: rgb(235, 223, 223);
  width: 350px;
  height: 450px;
  background-color: rgba(11, 236, 236, 0.315);
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  margin: auto; /*有了这个就自动居中了*/
  border-radius: 5px;
}
.login-Router-Link-Css {
  display: flex;
  justify-content: space-between;
}
.login-Router-Link-Left-Css {
  margin: 20px;
}
.login-Router-Link-Right-Css {
  margin: 20px;
}
.router-link {
  text-decoration: none;
  color: white;
}
.router-link-active {
  text-decoration: none;
  color: yellow;
}
.router-link-exact-active {
  text-decoration: none;
  color: yellow;
}
.login-Router-View-Css {
  margin-top: 50px;
}
.login-BGCanvas-Css {
  background-color: rgba(0, 0, 0, 0.884);
  height: calc(100%);
  position: absolute;
  width: 100%;
  z-index: -1;
}
</style>